package kr.co.redbean.frame
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import kr.co.redbean.events.MenuEvent;
	import kr.co.redbean.controls.MainButton;

	public final class MainMenu extends MainFrame implements IMainFrame
	{
		private var _home:MainButton;
		private var _magazine:MainButton;
		private var _clothing:MainButton;
		private var _accessories:MainButton;
		private var _blog:MainButton;
		private var _help:MainButton;
		
		
		public function MainMenu()
		{
			super();
			
			// start app
			_home = new MainButton('home');
			_magazine = new MainButton('magazine');
			_clothing = new MainButton('clothing');
			_accessories = new MainButton('accessories');
			_blog = new MainButton('blog');
			_help = new MainButton('help');
			
			addChild(_home);
			addChild(_magazine);
			addChild(_clothing);
			addChild(_accessories);
			addChild(_blog);
			addChild(_help);
			
			addEventListener(Event.ADDED_TO_STAGE, setPlacement);
		}
		
		public function setPlacement($e:Event=null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, setPlacement);
			
			x = posF.right - MAINMENU_WIDTH;
			y = posF.top - MENUBAR_HEIGHT;
			
			_home.x = 0;
			_magazine.x = _home.width + 15;
			_clothing.x = _magazine.x + _magazine.width + 15;
			_accessories.x = _clothing.x + _clothing.width + 15;
			_blog.x = _accessories.x + _accessories.width + 15;
			_help.x = _blog.x + _blog.width + 15;
		}
		override public function set alpha(value:Number):void {
			super.alpha = value;
		}
	}
}